package com.yang.qgg_demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import com.yang.qgg_demo.entity.Goods;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {

    @Select("SELECT SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) AS total_number FROM goods")
    public int selectTotalNumber();
}
